<%@ page language="java" contentType="text/html; charset=UTF-8"	isELIgnored="false"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>

	<head>
		<META charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
		
		<link href="css/bootstrap.min.css" rel="stylesheet">		
		<link href="css/site.css" rel="stylesheet">
		<link rel="stylesheet" href="css/owl.carousel.css" />
		<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" />
		<script src="js/jquery.min.js"></script>
		<script src="js/bootstrap.min.js"></script>
		<script src="js/bootstrap.js"></script>
		<script src="js/modernizr.js"></script>
		
		<title>主页</title>
	<style>
				* {
					margin: 0;
					padding: 0;
				}
				.lanren{ position:relative;}
				.lanren .title {
					text-align: left;
					color:#000000;
					font-size: 14px;
					position: absolute;
					bottom: -0.5rem;
				}
			  #innerFooter{
	            position: absolute;
	            bottom: 0; left: 2.5rem;
	            text-align: center;
	        }
	</style>
	</head>
<body>
	<div class="container">
			<div class="col-md-12">
				<div class="input-group input-search">
					<span class="input-group-btn">
				 	<button  type="submit"  class="btn btn-default" onclick="Back()"><i class="fa">返回 </i> </button>
				 	</span>
					<input type="text" class="form-control" name="q" id="q" placeholder="搜索宝贝" >
					<span class="input-group-btn">
					<button class="btn btn-default" type="submit" onclick="search()" ><i class="fa fa-search"></i></button>
					</span>
				</div>
			</div>
			
		<!-- 			<div class="row hu"> -->
		<!-- 				<div class="col-xs-12 col-sm-12"> -->
		<!-- 					<img src="img/nv1.png" class="img-responsive center-block"> -->
		<!-- 				</div> -->

		<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/H439I0N71ARI.jpg" class="img-responsive center-block" /></div> -->
		<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/H439I0N71ARI.jpg" class="img-responsive center-block" /></div> -->
		<!-- 			</div> -->
		<div class="row hu">
			<!-- 				<div class="col-xs-12 col-sm-12"> -->
			<!-- 					<img src="img/nan.png" class="img-responsive center-block"> -->
			<!-- 				</div> -->

			<c:forEach items="${goods}" var="g">
				<div class="col-xs-6 col-sm-6 lanren">
					<img src='../upload/${g["thumb"]}' class="img-responsive center-block" onclick="goodsDetail(${g['id']})" />
					<div class="title">
						<img src='../upload/${g["avatar"]}' class="img-circle"  width="15%"> &nbsp;&nbsp;
						<hsmall id="innerFooter">${g["nick"]}</small>
					</div>
				</div>
			</c:forEach>
			<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/H439I0N71ARI.jpg" class="img-responsive center-block" /></div> -->
			<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/383NF7SDB8CR.jpg" class="img-responsive center-block" /></div> -->
			<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/H439I0N71ARI.jpg" class="img-responsive center-block" /></div> -->
			<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/u=1429307038,825674002&fm=21&gp=0.jpg" class="img-responsive center-block" /></div> -->
			<!-- 				<div class="col-xs-6 col-sm-6"><img src="img/u=1429307038,825674002&fm=21&gp=0.jpg" class="img-responsive center-block" /></div> -->
		</div>
	</div>
	<script src="js/jquery.browser.mobile.js"></script>
		<script src="js/nanoscroller.js"></script>

		<!-- Specific Page Vendor -->
		<script src="js/owl.carousel.js"></script>

		<!-- Theme Base, Components and Settings -->
		<script src="js/theme.js"></script>

		<!-- Theme Custom -->
		<script src="js/theme.custom.js"></script>

		<!-- Theme Initialization Files -->
		<script src="js/theme.init.js"></script>
	<script type="text/javascript">
		function search() {
			var key = $("#q").val();
			this.location.href = './getAllGoodsByKey?key=' +key;
		}
		function Back() {
			this.location.href = './mainPage';
		}
		
		function goodsDetail(gid) {
			this.location.href = './webgoodsDetail?gid=' +gid;
		}
	</script>
</body>

</html>